Skip to content

Run the out-of-band management power-state task in a managed context to fix a connection leak - #14090

Open
nagaboinaramgopal wants to merge 1 commit into
apache:mainfrom
nagaboinaramgopal:pr/fix-oobm-connection-leak
Open

Run the out-of-band management power-state task in a managed context to fix a connection leak#14090
nagaboinaramgopal wants to merge 1 commit into
apache:mainfrom
nagaboinaramgopal:pr/fix-oobm-connection-leak

Conversation

@nagaboinaramgopal

Copy link
Copy Markdown
Contributor

Description

The out-of-band management power-state poll task submits a per-host power status task to a background executor. That task, PowerOperationTask, was a plain Runnable, while the poll task that submits it is a ManagedContextRunnable. Running the per-host work outside a managed context means the database connection its DB work acquires on the worker thread is never released back to the pool. Over time this leaks one connection per configured host on every run, and once the pool reaches maxActive the management server stops serving requests with "Connection is not available, request timed out".

This makes PowerOperationTask a ManagedContextRunnable, matching the poll task that submits it, so the managed context releases the connection when each run finishes.

Fixes: #13382

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

N/A

How Has This Been Tested?

Added a unit test that runs the task and checks it is a ManagedContextRunnable and that running it still performs the power operation, so the per-host work now runs inside a managed context and the delegation is unchanged.

How did you try to break this feature and the system with this change?

The change only wraps the existing per-host work in a managed context and does not change what it does. The sibling poll task that submits this task already uses the same managed-context base, so the two now behave consistently.

… context

The per-host power-state sync submitted to the background executor was a plain
Runnable, so the database connection its DB work acquires on the worker thread
was never released back to the pool. Over time one leaked connection per
configured host per run exhausted the pool (HikariPool active reaching
maxActive), and the management server stopped serving requests. Make
PowerOperationTask a ManagedContextRunnable, like the poll task that submits it,
so the managed context releases the connection when each run finishes.

Fixes: apache#13382
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connection Pool Leak in Out-of-Band Management (OOB) background task causes Management Server crash (HikariPool MaxActive Exhaustion)

1 participant